class Post < ActiveRecord::Base
  
  validates :dept_id, :employee_id, :name, :presence => true
  validates :dept_id, :uniqueness => { :scope => [ :employee_id, :name ] }
  
  belongs_to :dept
  belongs_to :employee
  
  def name
    ActiveSupport::StringInquirer.new(self[:name])
  end
end
